
<!DOCTYPE html>
<!--
 Licensed to the Apache Software Foundation (ASF) under one
 or more contributor license agreements.  See the NOTICE file
 distributed with this work for additional information
 regarding copyright ownership.  The ASF licenses this file
 to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
 "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 KIND, either express or implied.  See the License for the
 specific language governing permissions and limitations
 under the License.
 -->
<html>
<head>
  <meta charset="utf-8" />
  <meta name="format-detection" content="telephone=no" />
  <meta name="msapplication-tap-highlight" content="no" />
  <!-- WARNING: for iOS 7, remove the width=device-width and height=device-height attributes. See https://issues.apache.org/jira/browse/CB-4323 -->
  <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
  <link rel="stylesheet" type="text/css" href="css/index.css" />
  <title>Hello World</title>

  <script>
//    document.addEventListener("deviceready",onDeviceReady,false);
//
//    function onDeviceReady() {
//      alert("初始化 over");
//    }
  </script>
</head>
<body>
<div >
  <!--<h1>First page</h1>-->
  <div >
    <!--<p class="event listening">Connecting to Device</p>-->
    <!--<p class="event received">Device is Ready</p>-->
    <!--<button onclick="window.plugins.socialsharing.share('Message only', null, null, null, function(msg) {alert(msg)}, function(msg) {alert(msg)})">social sharing (needs plugin)</button>-->
    <!--<br/>-->
    <!--<button onclick="alert('running cordova ' + device.cordova + ' on ' + device.platform)">device test (needs plugin)</button>-->
    <!--<br/>-->
    <!--<button onclick="window.plugins.toast.showShortTop('Hello there!', function(a){console.log('toast success: ' + a)}, function(b){alert('toast error: ' + b)})">Toast showShortTop</button>-->
    <!--<br/>-->
    <!--<button onclick="loadXHR()">Load file via embedded HTTP server</button>-->
    <!--<br/>-->
    <!--<button onclick="document.getElementById('webglFrame').src='https://www.scirra.com/demos/c2/particles/'">load webgl iframe</button>-->
    <!--<br/>-->
    <!--<button onclick="inAppBrowser()">InAppBrowser</button>-->
    <!--<br/>-->
    <!--<button onclick="storeInLS1()">Store val1 in LS</button>-->
    <!--<br/>-->
    <!--<button onclick="storeInLS2()">Store val2 in LS</button>-->
    <!--<br/>-->
    <br/>
    <br/>
    <br/>
    <br/>
    <br/>

    <button onclick="testGetDeviceInfo()">获取设备信息</button>
    <br/>
    <button onclick="testMyPlugin()">测试自定义插件</button>
    <br/>
    <button onclick="testPlus()">10 + 20 = ？</button>
    <br/>
    <button onclick="testJumpPage()">页面跳转</button>
    <br/>
    
    <br/>
    <a href="https://github.com/eddyverbruggen" target="_blank">Test an external link</a>

  </div>
</div>
<script type="text/javascript" src="cordova.js"></script>
<script type="text/javascript" src="js/index.js"></script>
<script type="text/javascript" src="https://code.jquery.com/jquery-1.11.1.min.js"></script>
<script>


  function testGetDeviceInfo() {
    //alert("read: " + localStorage.getItem("mykey1") + " & " + localStorage.getItem("mykey2"));
    alert(device.platform + '\n ' + device.uuid + '\n ' +device.version + ' \n ' + device.name );

    console.log('Received Event ..... ');
  }


function testMyPlugin() {
    if(window.cordova){
        window.plugins.mjtest.test([{'name':'mj'}],function(data){consoloe.log(data)});
    }

}

function testPlus(){
   window.plugins.mjtest.plus([10,20],sucess,error);
}


function sucess(msg){
    console.log(typeof msg);
    alert(   msg);
}

function error(msg){
    alert(msg);
 
}

function testJumpPage(){
    window.plugins.mjtest.pushToPage([10],sucess,error);
    
}





</script>
<iframe id="webglFrame" src="" frameborder="0"></iframe>
</body>
</html>
